<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta charset="utf-8">
<title></title>
<!-- Mobile specific metas -->
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<!-- Force IE9 to render in normal mode -->
<!--[if IE]><meta http-equiv="x-ua-compatible" content="IE=9" /><![endif]-->
<meta name="author" content="SuggeElson" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<meta name="application-name" content="sprFlat admin template" />
<!-- Import google fonts - Heading first/ text second -->
<link rel='stylesheet' type='text/css'>
<!--[if lt IE 9]-->

<script type="text/javascript"
	src="<%=path%>/background/style/resource/Js/jquery.js"></script>
<!-- Css files -->
<!-- Icons -->
<link href="<%=path%>/background/style/assets/css/icons.css"
	rel="stylesheet" />
<!-- jQueryUI -->
<link
	href="<%=path%>/background/style/assets/css/sprflat-theme/jquery.ui.all.css"
	rel="stylesheet" />
<!-- Bootstrap stylesheets (included template modifications) -->
<link href="<%=path%>/background/style/assets/css/bootstrap.css"
	rel="stylesheet" />
<!-- Plugins stylesheets (all plugin custom css) -->
<link href="<%=path%>/background/style/assets/css/plugins.css"
	rel="stylesheet" />
<!-- Main stylesheets (template main css file) -->
<link href="<%=path%>/background/style/assets/css/main.css"
	rel="stylesheet" />
<!-- Custom stylesheets ( Put your own changes here ) -->
<link href="<%=path%>/background/style/assets/css/custom.css"
	rel="stylesheet" />
<!-- Fav and touch icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144"
	href="<%=path%>/background/style/assets/img/ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114"
	href="<%=path%>/background/style/assets/img/ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72"
	href="<%=path%>/background/style/assets/img/ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed"
	href="<%=path%>/background/style/assets/img/ico/apple-touch-icon-57-precomposed.png">
<link rel="icon"
	href="<%=path%>/background/style/assets/img/ico/favicon.ico"
	type="image/png">
<!-- Windows8 touch icon ( http://www.buildmypinnedsite.com/ )-->
<meta name="msapplication-TileColor" content="#3399cc" />
</head>
<body>
	<h3 style="margin-left: 30px;">店铺概况</h3>
	<hr>
	<div class="content-wrapper" style="margin-left: 30px;">
		<div class="row">
			<!-- Start .row -->
			<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12" onclick="getOrders()">
				<div class="carousel-tile carousel vertical slide">
					<div class="carousel-inner">
						<div class="item active">
							<div class="tile red">
								<div class="tile-icon">
									<i class="br-cart s64"></i>
								</div>
								<div class="tile-content">
									<div id="ordercount" class="number">107</div>
									<h3>订单</h3>
								</div>
							</div>
						</div>
					</div>
				</div>
				<!-- End Carousel -->
			</div>
			<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12" onclick="getComments()">
				<div class="carousel-tile carousel slide">
					<div class="carousel-inner">
						<div class="item active">
							<div class="tile blue">
								<div class="tile-icon">
									<i class="st-chat s64"></i>
								</div>
								<div class="tile-content">
									<div id ="commentscount" class="number">24</div>
									<h3>消息</h3>
								</div>
							</div>
						</div>

					</div>
				</div>
				<!-- End Carousel -->
			</div>
			<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12" onclick="getUsers()">
				<div class="carousel-tile carousel vertical slide">
					<div class="carousel-inner">
						<div class="item active">
							<div class="tile green">
								<div class="tile-icon">
									<i class="ec-users s64"></i>
								</div>
								<div class="tile-content">
									<div id=usercount class="number">325</div>
									<h3>总用户</h3>
								</div>
							</div>
						</div>

					</div>
				</div>
				<!-- End Carousel -->
			</div>
			<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12" onclick="getGoods()">
				<div class="carousel-tile carousel slide">
					<div class="carousel-inner">
						<div class="item active">
							<div class="tile teal">
								<!-- tile start here -->
								<div class="tile-icon">
									<i class="ec-images s64"></i>
								</div>
								<div class="tile-content">
									<div id = "goodscount" class="number">45</div>
									<h3>商品</h3>
								</div>
							</div>
						</div>
					</div>
				</div>
				<!-- End Carousel -->
			</div>
		</div>
	</div>
	<div class="row-fluid" style="margin-left: 100px;">
		<div class="block span6">
			<div class="block-heading">
				<span class="block-icon pull-right"> <a href="#"
					class="demo-cancel-click" rel="tooltip" title="Click to refresh"><i
						class="icon-refresh"></i></a>
				</span> <a href="#widget2container" data-toggle="collapse">最近添加的商品</a>
			</div>
			<div id="widget2container" class="block-body collapse in">
				<table class="table list">
					<tbody id = "tab1">
						<tr>
							<td>
								<p>
									<i class="glyphicon-user"></i> Mark Otto
								</p>
							</td>
							<td>
								<p>Amount: $1,247</p>
							</td>
							<td>
								<p>Date: 7/19/2012</p> <a href="#">View Transaction</a>
							</td>
						</tr>
						<tr>
							<td>
								<p>
									<i class="glyphicon-user"></i> Audrey Ann
								</p>
							</td>
							<td>
								<p>Amount: $2,793</p>
							</td>
							<td>
								<p>Date: 7/12/2012</p> <a href="#">View Transaction</a>
							</td>
						</tr>
						<tr>
							<td>
								<p>
									<i class="glyphicon-user"></i> Mark Tompson
								</p>
							</td>
							<td>
								<p>Amount: $2,349</p>
							</td>
							<td>
								<p>Date: 3/10/2012</p> <a href="#">View Transaction</a>
							</td>
						</tr>
						<tr>
							<td>
								<p>
									<i class="glyphicon-user"></i> Ashley Jacobs
								</p>
							</td>
							<td>
								<p>Amount: $1,192</p>
							</td>
							<td>
								<p>Date: 1/19/2012</p> <a href="#">View Transaction</a>
							</td>
						</tr>

					</tbody>
				</table>
			</div>
		</div>
	</div>
	<hr>
</body>
</html>
<script>
	$(function() {

		getOrderCount();
		getUserCount();
		getGoodsCount();
		getCommentCount();
		getNewGoods();
	});

	
	
	function getNewGoods() {
		$.post("/tbpoject/business2/getnewgoods", {},
					function(info) {
						var data = $.parseJSON(info);
						if(data!=""&&data!=null){
						var tab = $("#tab1");
						var msg = "";
						tab.html("");
						for (var i = 0; i < 4; i++) {
							msg += "<tr>";
							msg += "<td><p><i class='glyphicon-user'></i>"+data[i].name + "</p></td>";
							msg += "<td><p>Price: $"+data[i].price + "</p></td>";
							msg += "<td><p>Date:"+data[i].time + "</p><a href='#'>View Transaction</a></td>";
							msg += "</tr>";
						}
						tab.html(tab.html() + msg);
					}
		})
	}
	function getOrderCount() {
		$.post("/tbpoject/business1/getordercount", {}, function(data) {
			$("#ordercount").html(data);
		})
	}
	
	function getUserCount() {
		$.post("/tbpoject/business1/getusercount", {}, function(data) {
			$("#usercount").html(data);
		})
	}
	
	function getGoodsCount() {
		$.post("/tbpoject/business2/getgoodscount", {}, function(data) {
			$("#goodscount").html(data);
		})
	}
	
	function getCommentCount() {
		$.post("/tbpoject/business4/getcommentscount", {}, function(data) {
			$("#commentscount").html(data);
		})
	}
	
	function getOrders(){
		window.location.href = "/tbpoject/background/business/orderform.jsp";
	}
	function getComments(){
		window.location.href = "/tbpoject/background/business/comment.jsp";
	}
	function getUsers(){
		window.location.href = "/tbpoject/background/business/usersform.jsp";
	}
	function getGoods(){
		window.location.href = "/tbpoject/background/business/warehouse.jsp";
	}
	
	
	
</script>